package com.cdgc.web.service.Impl;

import com.cdgc.web.mapper.VipTableMapper;
import com.cdgc.web.pojo.VipTable;
import com.cdgc.web.service.VipService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class VipServiceImpl implements VipService {
    @Resource
    private  VipTableMapper vipTableMapper;

    @Override
    public List<VipTable> queryAllVips() {
        return vipTableMapper.selectByExample(null);
    }

    @Override
    public void addNewVip(VipTable vipTable) {
        vipTableMapper.insert(vipTable);
    }

    @Override
    public void deleteVipById(Integer id) {
        vipTableMapper.deleteByPrimaryKey(id);
    }

    @Override
    public VipTable toUpdateVipById(Integer id) {
        return vipTableMapper.selectByPrimaryKey(id);
    }

    @Override
    public void UpdateVip(VipTable vipTable) {
        vipTableMapper.updateByPrimaryKey(vipTable);
    }
}
